Skip to content

Fix signature of CodecInfo.decode #12610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 1, 2024
Merged

Fix signature of CodecInfo.decode #12610

merged 2 commits into from
Sep 1, 2024

Conversation

tomasr8
Copy link
Member

@tomasr8 tomasr8 commented Sep 1, 2024

Closes #10656

I ran into the same issue recently. The actual type of input is memoryview which tripped me up because I was calling input.decode("utf-8") which of course fails for a memoryview.

This comment has been minimized.

Co-authored-by: Akuli <[email protected]>
Copy link
Contributor

github-actions bot commented Sep 1, 2024

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Akuli Akuli merged commit 6b1566d into python:main Sep 1, 2024
63 checks passed
@tomasr8 tomasr8 deleted the decoder branch September 1, 2024 17:30
max-muoto pushed a commit to max-muoto/typeshed that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

codecs._Decoder is incorrectly annotated as taking input: bytes, while at runtime it receives memoryview
2 participants